package cate.game.play.skill.passive.exp;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.proce.action.ctx.TimeActionCtx;
import cate.game.play.proce.move.MoveCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 若回合内未释放武将主动技能，则提升自身30%暴击率，可叠加,不可驱散,该效果出手后消失
 */
public class 厚积薄发PH extends PassiveHandler {

	private int buff;

	//buff=??
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		buff = args.getInt("buff", 0);
	}

	private int lastMoveRound;

	@Override
	public void onOwnerMoveDone(MoveCtx move, TimeActionCtx action) {
		lastMoveRound = move.getRound().index;
		skill.owner.buff.removeBuffByTid(action, buff);
	}

	@Override
	public void onRoundEnd(ActionCtx action) {
		if (lastMoveRound < action.getRound().index) {
			skill.owner.buff.tryAddByTid(action, buff);
		}
	}
}
